package com.zzyl.nursing.service.impl;

import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.zzyl.nursing.mapper.MemberOrdersMapper;
import com.zzyl.nursing.service.MemberOrdersService;
import com.zzyl.serve.domain.NursingProject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MemberOrdersServiceImpl extends ServiceImpl<MemberOrdersMapper, NursingProject> implements MemberOrdersService {
    @Autowired
    private MemberOrdersMapper memberOrdersMapper;

    @Override
    public List<NursingProject> page(String name, Integer pageNum, Integer pageSize, Integer status) {
        List<NursingProject> result = this.list(Wrappers.<NursingProject>lambdaQuery()
                .eq(status != null, NursingProject::getStatus, status)
                .like(StringUtils.isNotBlank(name), NursingProject::getName, name)
        );
        return result;
//        return memberOrdersMapper.page(name, status);
    }
}
